package lt.f2g.domain.forum;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import lt.f2g.domain.BaseEntity;
import lt.f2g.domain.comments.CommentThread;

@Entity
public class ForumThread extends BaseEntity {
    
    private String author;
    
    private String topic;
    
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreated;
    
    private String text;
    
    @OneToOne(cascade=CascadeType.ALL)
    @JoinColumn(name="COMMENT_THREAD_ID")
    private CommentThread commentThread;
    
    public CommentThread getCommentThread() {
        return commentThread;
    }
    public void setCommentThread(CommentThread commentThread) {
        this.commentThread = commentThread;
    }
    public String getAuthor() {
        return author;
    }
    public void setAuthor(String author) {
        this.author = author;
    }
    public String getTopic() {
        return topic;
    }
    public void setTopic(String topic) {
        this.topic = topic;
    }
    public Date getDateCreated() {
        return dateCreated;
    }
    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }
    public String getText() {
        return text;
    }
    public void setText(String text) {
        this.text = text;
    }

}
